package com

class MyReportTagLib {
	
	def myReport = {attrs ->
		
		String arquivo=attrs.arquivo
		String titulo=attrs.titulo
		String format=attrs.format
		
		String[] formatos=format.split(",")
		
		out << '<div class="report">\n'
		out << "<form class=\"jasperReport\" name=\"${arquivo}\" action=\"/CashFinancas/jasper/\">\n"
		out << "	Formato: "
		out << '	<select name="_format">\n'
		formatos.each {
			out << "		<option value=\"${it}\">${it}</option>\n"
		}
		out << '	</select>\n'
		out << "	<input class=\"name\" type=\"hidden\" name=\"_name\" value=\"${titulo}\" />\n"
		out << "	<input type=\"hidden\" name=\"_file\" value=\"${arquivo}\" />\n"
		out << '	<input type="submit" value="Emitir relatorio" />\n'
		out << '</form>\n'
		out << '</div>\n'
	
	}

}
